#ifndef QIMAGEVIEWER_H
#define QIMAGEVIEWER_H

#include <QtGui/QLabel>
#include <QPaintEvent>

class QImageViewer : public QLabel
{
    Q_OBJECT

public:
    QImageViewer(QWidget *parent = 0);
    void setImage(QString s);
    void setImage(QByteArray s);
    ~QImageViewer();
    virtual void setGeometry(int x, int y, int width, int height);
    virtual void setGeometry(const QRect & r);

private:
    QImage m_Img;
    QString m_Path;
    bool m_init;
    int m_x, m_y, m_width, m_height, m_maxWidth, m_maxHeight;
    virtual void paintEvent(QPaintEvent *);

    void setSize(int,int);

};

#endif // QIMAGEVIEWER_H
